package me.idashu.attg.service;

import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.AdverEntity;
import me.idashu.attg.persistence.AdverMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdverService {

	@Autowired
	private AdverMapper adverMapper;

	public void insertAdver(AdverEntity adverEntity) {
		adverMapper.insertAdver(adverEntity);
	}

	public List<AdverEntity> findAdversByShopIdPage(Map<String, Object> map) {
		List<AdverEntity> advers = adverMapper.findAdversByShopIdPage(map);
		return advers;
	}

	public int findCountAdversByShopIdPage(AdverEntity adverEntity) {
		int count = adverMapper.findCountAdversByShopIdPage(adverEntity);
		return count;
	}
	public void deleteAdver(long adverId){
		adverMapper.deleteAdver(adverId);
	}
	
	public AdverEntity findOne(long adverId){
		AdverEntity adver = adverMapper.findOne(adverId);
		return adver;
	}
	public List<AdverEntity> findAdversByShopId(long shopId){
		List<AdverEntity> advers = adverMapper.findAdversByShopId(shopId);
		return advers;
	}
	
	public List<AdverEntity> findAdversByShopIdToInter(long shopId){
		List<AdverEntity> advers = adverMapper.findAdversByShopIdToInter(shopId);
		return advers;
	}

}
